package com.esd.device.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 采集的终端状态，以及该状态的持续时间
 */
@Data
@TableName("tb_esd_log")
public class EsdLog {
    @TableId(value = "esd_log_id", type = IdType.AUTO)
    private Long esdLogId;
    private Long deviceId ;
    private String stationId;
    private String deviceTypeName;
    private String channelName ;
    private String line ;
    private String lineAndPosition ;
    private String status ; // 正常、待机、失联、异常 4个状态
    private String statusDesc; // 终端状态描述
    private Boolean enabled ; // 是否启用
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime; // 状态开始时间
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;  // 状态结束时间
}
